<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>
    <transition appear>
      <h1 v-show="isShow">Hello</h1>
    </transition>
  </div>
</template>

<script>
  export default {
    name: 'Test1',
    data(){
      return{
        isShow: true
      }
    }
  }
</script>

<style scoped>
  h1 {
    background-color: orange;
  }
  .v-enter-active{
    animation: donghua 0.5s linear;
  }
  .v-leave-active{
    animation: donghua 0.5s linear reverse;
  }

  @keyframes donghua {
    from{
      transform: translateX(-100%);
    }
    to{
      transform: translateX(0px);
    }
  }

</style>